package com.uriuniv.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.jdbc.core.RowMapper;

import com.uriuniv.domain.BoardArticle;

public class BoardArticleM implements RowMapper {

	public Object mapRow(ResultSet rs, int rowNum) throws SQLException {

		BoardArticle ba = new BoardArticle();
		
		ba.setArticleId(rs.getString("ARTICLE_ID").trim());
		ba.setBoardId(rs.getString("BOARD_ID").trim());
		ba.setHit(rs.getInt("HIT"));
		ba.setModDate(rs.getTimestamp("MOD_DATE"));
		ba.setRegDate(rs.getTimestamp("REG_DATE"));
		ba.setStudentId(rs.getString("STUDENT_ID").trim());
		ba.setSubstance(rs.getString("SUBSTANCE"));
		ba.setTitle(rs.getString("TITLE"));
		ba.setUnivId(rs.getString("UNIV_ID").trim());
		ba.setName(rs.getString("NAME"));
		ba.setUnivName(rs.getString("UNIV_NAME"));
		
		return ba;
	}
	
}
